/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import com.sun.istack.internal.NotNull;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author RISKHA
 */
@Entity
@Table(name = "user")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "User.findAll", query = "SELECT u FROM User u"),
    @NamedQuery(name = "User.findById", query = "SELECT u FROM User u WHERE u.id = :id"),
    @NamedQuery(name = "User.findByBeratbadan", query = "SELECT u FROM User u WHERE u.beratbadan = :beratbadan"),
    @NamedQuery(name = "User.findByNamalengkap", query = "SELECT u FROM User u WHERE u.namalengkap = :namalengkap"),
    @NamedQuery(name = "User.findByLamasakit", query = "SELECT u FROM User u WHERE u.lamasakit = :lamasakit"),
    @NamedQuery(name = "User.findByKadargula", query = "SELECT u FROM User u WHERE u.kadargula = :kadargula"),
    @NamedQuery(name = "User.findByEmail", query = "SELECT u FROM User u WHERE u.email = :email"),
    @NamedQuery(name = "User.findByUmur", query = "SELECT u FROM User u WHERE u.umur = :umur"),
    @NamedQuery(name = "User.findByCatatan", query = "SELECT u FROM User u WHERE u.catatan = :catatan"),
    @NamedQuery(name = "User.findByJeniskelamin", query = "SELECT u FROM User u WHERE u.jeniskelamin = :jeniskelamin"),
    @NamedQuery(name = "User.findByUsername", query = "SELECT u FROM User u WHERE u.username = :username"),
    @NamedQuery(name = "User.findByPass", query = "SELECT u FROM User u WHERE u.pass = :pass")})
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Long id;
    @Column(name = "BERATBADAN")
    private String beratbadan;
    @Column(name = "NAMALENGKAP")
    private String namalengkap;
    @Column(name = "LAMASAKIT")
    private String lamasakit;
    @Column(name = "KADARGULA")
    private String kadargula;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
    @Column(name = "EMAIL")
    private String email;
    @Column(name = "UMUR")
    private Integer umur;
    @Column(name = "CATATAN")
    private String catatan;
    @Column(name = "JENISKELAMIN")
    private String jeniskelamin;
    @Column(name = "USERNAME")
    private String username;
    @Column(name = "PASS")
    private String pass;

    public User() {
    }

    public User(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getBeratbadan() {
        return beratbadan;
    }

    public void setBeratbadan(String beratbadan) {
        this.beratbadan = beratbadan;
    }

    public String getNamalengkap() {
        return namalengkap;
    }

    public void setNamalengkap(String namalengkap) {
        this.namalengkap = namalengkap;
    }

    public String getLamasakit() {
        return lamasakit;
    }

    public void setLamasakit(String lamasakit) {
        this.lamasakit = lamasakit;
    }

    public String getKadargula() {
        return kadargula;
    }

    public void setKadargula(String kadargula) {
        this.kadargula = kadargula;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getUmur() {
        return umur;
    }

    public void setUmur(Integer umur) {
        this.umur = umur;
    }

    public String getCatatan() {
        return catatan;
    }

    public void setCatatan(String catatan) {
        this.catatan = catatan;
    }

    public String getJeniskelamin() {
        return jeniskelamin;
    }

    public void setJeniskelamin(String jeniskelamin) {
        this.jeniskelamin = jeniskelamin;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof User)) {
            return false;
        }
        User other = (User) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "enitity.User[ id=" + id + " ]";
    }
    
}
